package cn.yanhu.kuwanapp.earn

import androidx.lifecycle.MutableLiveData
import cn.woochen.comlib.BaseViewModel
import cn.yanhu.kuwanapp.bean.response.RespCarouselBean
import cn.yanhu.kuwanapp.bean.response.RespGameListBean
import cn.yanhu.kuwanapp.bean.response.RespUserInfoBean
import cn.yanhu.kuwanapp.http.status.ResultState
import cn.yanhu.kuwanapp.utils.ext.request
import cn.yanhu.kuwanapp.utils.ext.rxApi
import retrofit2.http.Query

class GameViewModel:BaseViewModel() {
    val gameListInfo  = MutableLiveData<ResultState<List<RespGameListBean>>>()
    val gameSearchInfo  = MutableLiveData<ResultState<List<RespGameListBean>>>()

    //游戏列表
    fun gameList(source: String,type: Int,pageNo: Int){
        request({ rxApi.gameList(source,type, pageNo) }, gameListInfo,true)
    }

    //游戏搜索
    fun gameSearch(searchtxt: String){
        request({ rxApi.gameSearch(searchtxt) }, gameSearchInfo,true)
    }
}